<?php

$app = app();

// 后台接口
$app->router->group([
    'namespace' => 'App\Edu\Controllers',
    'prefix' => 'admin',
    // 'middleware' => ['admin.auth']
], function ($router) {
    // 试卷
    $router->post('/edu/paper/save', 'EduController@savePaper');
    $router->delete('/edu/paper/delete', 'EduController@deletePaper');
    $router->post('/edu/paper/change-status', 'EduController@changePaperStatus');
    $router->get('/edu/paper/list', 'EduController@getPaperList');
    $router->post('/edu/paper/import', 'EduController@importPaper');
    // 课程
    $router->get('/edu/course/list', 'EduController@getCourseList');
    $router->post('/edu/course/save', 'EduController@saveCourse');
    $router->delete('/edu/course/delete', 'EduController@deleteCourse');
    $router->post('/edu/course/change-status', 'EduController@changeCourseStatus');
    $router->post('/edu/course/lesson/save', 'EduController@saveCourseLesson');
    $router->delete('/edu/course/lesson/delete', 'EduController@deleteCourseLesson');
    $router->get('/edu/question-type', 'EduController@getQuestionType');
    // 题目
    $router->post('/edu/question/save', 'EduController@saveQuestion');

});

// 小程序接口无需授权
$app->router->group([
    'namespace' => 'App\Exhibitors\Controllers',
    'prefix' => 'api/edu',
    // 'middleware' => ['miniprog.auth']
], function ($router) {
    $router->get('/paper/list', 'ApiController@paperList');
    $router->get('/paper/info', 'ApiController@paperInfo');
});
